//
//  MineMessageCollectionCell.swift
//  E-CycleForShop
//
//  Created by enghou on 17/3/9.
//  Copyright © 2017年 xyxorigation. All rights reserved.
//

import UIKit

class MineMessageCollectionCell: UICollectionViewCell {
    
    var model = MineMessageModel.init() {
        didSet{
            titleLbl.text = "您申请的" + model.type + "提现金额:" + model.amount + ",提现成功.可进入" + model.type + "查看"
            let size = titleLbl.text!.stringSize(font: titleLbl.font, maxWid: self.width() - 74 * YXWidthScale)
            titleLbl.frame = CGRect.init(origin: CGPoint.init(x: 48 * YXWidthScale, y: 40 * YXWidthScale), size: CGSize.init(width: size.width, height: size.height))
            
            
            dateLbl.text = model.timeStr
            let size1 = dateLbl.text!.StringSize(font: dateLbl.font)
            dateLbl.frame = CGRect.init(origin: CGPoint.init(x: titleLbl.left(), y: titleLbl.bottom() + 30 * YXHeightScale), size: size1)
        }
    }
    
    private var titleLbl = UILabel.init()
    private var dateLbl = UILabel.init()
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        self.backgroundColor = UIColor.white
        self.layer.cornerRadius = YXButtonCorner
        self.layer.borderColor = UIColor.colorWithHexString(hex: "dfdfdf").cgColor
        self.layer.borderWidth = YXWidthScale
        let dot = UIView.init()
        dot.frame = CGRect.init(origin: CGPoint.init(x: 26 * YXWidthScale, y: 50 * YXHeightScale), size: CGSize.init(width: 12 * YXHeightScale, height: 12 * YXHeightScale))
        dot.backgroundColor = UIColor.colorWithHexString(hex: "ff2f2b")
        dot.layer.cornerRadius = 6 * YXHeightScale
        self.contentView.addSubview(dot)
        
        titleLbl.numberOfLines = 2
        titleLbl.textColor = UIColor.colorWithHexString(hex: "2c2c2c")
        titleLbl.font = UIFont.systemFont(ofSize: 32 * YXWidthScale)
        self.contentView.addSubview(titleLbl)
        
        dateLbl.textColor = UIColor.colorWithHexString(hex: "909090")
        dateLbl.font = UIFont.systemFont(ofSize: 24 * YXWidthScale)
        self.contentView.addSubview(dateLbl)
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}
